<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<script>
	$(function () {
		btn.onclick = function() {
			var keywordVlaue = document.querySelector("#keyword").value;
			console.log(keywordVlaue);

			var script = document.createElement("script");
			script.src = "https://suggest.taobao.com/sug?q="+keywordVlaue+"&callback=hehe";
			window["hehe"] = function(data) {
				var liTag = "";
				for(var i = 0;i < data) {
					
				}
			}
			var head = document.querySelector("head");
			head.appendChild(script);
		}
		
	})
	</script>
</head>
<body>
	<input type="text" id="keyword" placeholder="请输入相关的关键字">
	<input type="button" id="btn" value="查询">

	<ul>
		<li>1</li>
		<li>2</li>
		<li>3</li>
		<li>4</li>
		<li>5</li>
	</ul>
</body>
</html>